package com.example.springboot.service;

import com.example.springboot.entity.MockData;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Service
public class MockDataService {

    /**
     * 构造数据
     *
     * @return
     */
    public List<MockData> list() {
        List<MockData> dataList = new ArrayList<>();
        for (int i = 1; i <= 10; i++) {
            MockData data = new MockData();
            data.setId(i);
            data.setTitle("标题" + i);
            data.setContent("这是第" + i + "条模拟数据的内容");
            data.setCreateTime(new Date());
            dataList.add(data);
        }
        return dataList;
    }
}
